﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using 玩具商城管理系统.start;

namespace 玩具商城管理系统
{
    public partial class Tm : Form
    {
        public Tm()
        {
            InitializeComponent();
        }

        private void 修改密码ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            start.ChangePwd ch1 = new start.ChangePwd();
            ch1.ShowDialog();
        }

        private void 个人信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            start.Person p1 = new start.Person();
            p1.ShowDialog();
        }

        private void 返回ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            newwin.flag = 1;
            Form1.flag = 1;
            this.Close();
        }

        private void 添加商品信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tproduct.TAdd inl = new Tproduct.TAdd();
            inl.ShowDialog();
        }

        private void 修改商品信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tproduct.Tinsert tl = new Tproduct.Tinsert();
            tl.ShowDialog();
        }

        private void 删除商品信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tproduct.Treduce dl = new Tproduct.Treduce();
            dl.ShowDialog();
        }

        private void 审核商品订单ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Order.Check_order c1 = new Order.Check_order();
            c1.ShowDialog();
        }

        private void 日志查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Log.log_order sl = new Log.log_order();
            sl.ShowDialog();
        }

        private void 删除商品订单ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Order.Delete_order or = new Order.Delete_order();
            or.ShowDialog();
        }

        private void 添加部门信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {

            if (login.Bflag == false)
            {
                DialogResult dr = MessageBox.Show("请以管理员身份登录", "提示", MessageBoxButtons.OKCancel,
                    MessageBoxIcon.Information);
                if (dr == DialogResult.OK)
                {
                    this.Close();
                    login l1 = new login();
                }
                else
                {
                    return;
                }
            }
            else
            {
                Department.add_department i1 = new Department.add_department();
                i1.ShowDialog();
            }

        }

        private void 修改部门信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (login.Bflag == false)
            {
                DialogResult dr = MessageBox.Show("请以管理员身份登录", "提示", MessageBoxButtons.OKCancel,
                    MessageBoxIcon.Information);
                if (dr == DialogResult.OK)
                {
                    this.Close();
                    login l2 = new login();
                }
                else
                {
                    return;
                }
            }
            else
            {
                Department.insert_department i2 = new Department.insert_department();
                i2.ShowDialog();
            }
        }

        private void 删除部门信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (login.Bflag == false)
            {
                DialogResult dr = MessageBox.Show("请以管理员身份登录", "提示", MessageBoxButtons.OKCancel,
                    MessageBoxIcon.Information);
                if (dr == DialogResult.OK)
                {
                    this.Close();
                    login l3 = new login();
                }
                else
                {
                    return;
                }
            }
            else
            {
                Department.reduce_department i3 = new Department.reduce_department();
                i3.ShowDialog();

            }
        }

        private void 员工管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void 修改用户信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Changeclient cc = new Changeclient();
            cc.ShowDialog();
        }

        private void 审核退货订单ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            znew.th zz = new znew.th();
            zz.ShowDialog();
        }

        private void 业绩查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            start.score sc= new start.score();  
            sc.ShowDialog();
        }

        private void 订单分析ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Order.trouble trb= new Order.trouble();
            trb.ShowDialog();
        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
